package com.ruoyi.business.mapper;

import java.util.Date;
import java.util.List;
import com.ruoyi.business.domain.Score;
import com.ruoyi.business.domain.dto.FrontLineChartDTO;
import com.ruoyi.business.domain.dto.FrontListByTestSessionDTO;
import com.ruoyi.business.domain.vo.FrontPieChartVO;
import com.ruoyi.business.domain.vo.PointVO;
import org.apache.ibatis.annotations.Param;
import org.apache.poi.hpsf.Decimal;

/**
 * 成绩Mapper接口
 * 
 * @author lcz
 * @date 2025-02-23
 */
public interface ScoreMapper 
{
    /**
     * 查询成绩
     * 
     * @param id 成绩主键
     * @return 成绩
     */
    public Score selectScoreById(Long id);

    /**
     * 查询成绩列表
     * 
     * @param score 成绩
     * @return 成绩集合
     */
    public List<Score> selectScoreList(Score score);

    /**
     * 新增成绩
     * 
     * @param score 成绩
     * @return 结果
     */
    public int insertScore(Score score);

    /**
     * 修改成绩
     * 
     * @param score 成绩
     * @return 结果
     */
    public int updateScore(Score score);

    /**
     * 删除成绩
     * 
     * @param id 成绩主键
     * @return 结果
     */
    public int deleteScoreById(Long id);

    /**
     * 批量删除成绩
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteScoreByIds(Long[] ids);

    List<Score> findLatestScoresByStudentIdAndProjectType(@Param("studentId") Long studentId,@Param("projectType") String projectType);

    List<PointVO> getWeekMaxList(FrontLineChartDTO dto);

    List<PointVO> getWeekMinList(FrontLineChartDTO dto);

    List<PointVO> getMonthMaxList(FrontLineChartDTO dto);

    List<PointVO> getMonthMinList(FrontLineChartDTO dto);

    List<PointVO> getYearMaxList(FrontLineChartDTO dto);

    List<PointVO> getYearMinList(FrontLineChartDTO dto);

    List<Score> frontListByTestSession(FrontListByTestSessionDTO dto);
    List<Score> frontListByTestSessionRun(FrontListByTestSessionDTO dto);

    List<PointVO> getAVGMaxWeekListByProjectType(@Param("projectType") String projectType, @Param("studentIds") List<Long> studentIds);

    List<PointVO> getAVGMinWeekListByProjectType(@Param("projectType") String projectType, @Param("studentIds") List<Long> studentIds);

    List<PointVO> getAVGMaxListByProjectType(@Param("projectType") String projectType, @Param("studentIds") List<Long> studentIds);

    List<PointVO> getAVGMinListByProjectType(@Param("projectType") String projectType, @Param("studentIds") List<Long> studentIds);

    List<FrontPieChartVO> getFrontPieChart(@Param("testSessionId") Long testSessionId,@Param("projectType") String projectType,@Param("classId") Long classId);

    List<FrontPieChartVO> getFrontPieChartRun(@Param("testSessionId") Long testSessionId,@Param("projectType") String projectType,@Param("classId") Long classId);

    Score selectScoreByHaveHeight(Long studentId);

    Score selectScoreByHaveWeight(Long studentId);

    /**
     * 查询某场次下所有学生ID
     */
    List<Long> selectStudentIdsByTestSessionId(Long testSessionId);

    /**
     * 查询某场次某学生所有成绩
     */
    List<com.ruoyi.business.domain.Score> selectScoresByTestSessionAndStudent(@Param("testSessionId") Long testSessionId,@Param("studentId") Long studentId);

    /**
     * 查询某场次下所有成绩
     */
    List<Score> selectScoresByTestSessionId(Long testSessionId);
}
